/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package com.hiraeth.modules.job.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hiraeth.common.utils.PageParams;
import com.hiraeth.common.utils.PageUtils;
import com.hiraeth.common.utils.Query;
import com.hiraeth.modules.job.dao.ScheduleJobLogDao;
import com.hiraeth.modules.job.entity.ScheduleJobLogEntity;
import com.hiraeth.modules.job.service.ScheduleJobLogService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("scheduleJobLogService")
public class ScheduleJobLogServiceImpl extends ServiceImpl<ScheduleJobLogDao, ScheduleJobLogEntity> implements ScheduleJobLogService {

	@Override
	public IPage<ScheduleJobLogEntity> queryPage(PageParams<ScheduleJobLogEntity> pageParams) {
		ScheduleJobLogEntity query = pageParams.mapToObject(ScheduleJobLogEntity.class);
		QueryWrapper<ScheduleJobLogEntity> queryWrapper = new QueryWrapper<>();
		queryWrapper.lambda()
				.like(ObjectUtils.isNotEmpty(query.getJobId()), ScheduleJobLogEntity::getJobId, query.getJobId());
		return baseMapper.selectPage(pageParams, queryWrapper);
	}

}
